﻿//-----------------------------------------------------------------------
// <copyright file="ITrackerService.cs" company="Numbrella foundation">
// Copyright (c) Numbrella foundation. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

namespace Numbrella.Interaction
{
	using System.Collections.Generic;
	using System.ServiceModel;
	
	/// <summary>
	/// Represents interface of tracker WCF service.
	/// </summary>
	[ServiceContract]
	public interface ITrackerService
	{
		/// <summary>
		/// Retrieves definition of a problem that has not been solved yet.
		/// </summary>
		/// <returns>Pending problem definition.</returns>
		[OperationContract]
		ProblemDefinition GetPendingProblem();

        /// <summary>
        /// Adds new problem to tracker.
        /// </summary>
        /// <param name="name">Unique problem name.</param>
        /// <param name="description">Problem description.</param>
        /// <param name="implementation">Problem implementation aspects.</param>
        [OperationContract]
	    void AddProblem(string name, ProblemDescription description, ProblemImplementation implementation);

		/// <summary>
		/// Notifies tracker about pending problem.
		/// </summary>
        /// <param name="problemName">Unique problem name.</param>
		/// <param name="problemHostingPort">Port on the client where problem hosting service is listening.</param>		
		[OperationContract]
		void ReadyForSeed(string problemName, int problemHostingPort);

		/// <summary>
		/// Notifies tracker that problem must be deleted.
		/// </summary>
        /// <param name="name">Unique problem name.</param>
		[OperationContract]
		void DeleteProblem(string name);

        /// <summary>
        /// Notifies tracker that task of a given problem was solved, so tracker can increase rating for user who solved that task.
        /// </summary>
        /// <param name="problemName">Unique problem name.</param>
        /// <param name="taskId">Unique identifier of the solved task.</param>
        /// <param name="userNames">Names of the users participating in solving the task.</param>
		[OperationContract]
        void NotifyAboutTaskCompletion(string problemName, int taskId, IEnumerable<string> userNames);
	}
}